<?php
/**
 * Генератор
 * 
 * Класс  содержит служебные функции, связанные с различной генерацией (в частности с генерацией паролей)
 * 
 * @author Дмитрий Кузьма <kouzma.d@gmail.com>
 * @version 1.0
 */
class Service_Generate {

	
	public static $arrTrans = array("а"=>"a", "б"=>"b", "в"=>"v", "г"=>"g", "д"=>"d", "е"=>"e",
		"ё"=>"jo", "ж"=>"zh", "з"=>"z", "и"=>"i", "й"=>"j", "к"=>"k", "л"=>"l",
		"м"=>"m", "н"=>"n", "о"=>"o", "п"=>"p", "р"=>"r", "с"=>"s", "т"=>"t", "у"=>"u",
		"ф"=>"f", "х"=>"kh", "ц"=>"c", "ч"=>"ch", "ш"=>"sh", "щ"=>"shh", "ы"=>"y",
		"э"=>"eh", "ю"=>"yu", "я"=>"ya", "А"=>"a", "Б"=>"b", "В"=>"v", "Г"=>"g",
		"Д"=>"d", "Е"=>"e", "Ё"=>"jo", "Ж"=>"zh", "З"=>"z", "И"=>"i", "Й"=>"jj",
		"К"=>"k", "Л"=>"l", "М"=>"m", "Н"=>"n", "О"=>"o", "П"=>"p", "Р"=>"r", "С"=>"s",
		"Т"=>"t", "У"=>"u", "Ф"=>"f", "Х"=>"kh", "Ц"=>"c", "Ч"=>"ch", "Ш"=>"sh",
		"Щ"=>"shh", "Ы"=>"y", "Э"=>"eh", "Ю"=>"yu", "Я"=>"ya", " "=>"_", "."=>"_",
		","=>"_", "-"=>"_", "+"=>"_", ":"=>"_", ";"=>"_", "!"=>"_", "?"=>"_");

	public static $arrDiac = array(
'Á' => 'A', 
'á' => 'a', 'À' => 'A', 'à' => 'a', 'Ă' => 'A', 'ă' => 'a', 'Ắ' => 'A', 'ắ' => 'a', 
'Ằ' => 'A', 'ằ' => 'a', 'Ẵ' => 'A', 'ẵ' => 'a', 'Ẳ' => 'A', 'ẳ' => 'a', 'Â' => 'A', 
'â' => 'a', 'Ấ' => 'A', 'ấ' => 'a', 'Ầ' => 'A', 'ầ' => 'a', 'Ẫ' => 'A', 'ẫ' => 'a', 
'Ẩ' => 'A', 'ẩ' => 'a', 'Ǎ' => 'A', 'ǎ' => 'a', 'Å' => 'A', 'å' => 'a', 'Ǻ' => 'A', 
'ǻ' => 'a', 'Ä' => 'A', 'ä' => 'a', 'Ǟ' => 'A', 'ǟ' => 'a', 'Ã' => 'A', 'ã' => 'a', 
'Ȧ' => 'A', 'ȧ' => 'a', 'Ǡ' => 'A', 'ǡ' => 'a', 'Ą' => 'A', 'ą' => 'a', 'Ā' => 'A', 
'ā' => 'a', 'Ả' => 'A', 'ả' => 'a', 'Ȁ' => 'A', 'ȁ' => 'a', 'Ȃ' => 'A', 'ȃ' => 'a', 
'Ạ' => 'A', 'ạ' => 'a', 'Ặ' => 'A', 'ặ' => 'a', 'Ậ' => 'A', 'ậ' => 'a', 'Ḁ' => 'A', 
'ḁ' => 'a', 'Ⱥ' => 'A', 'Ⱬ' => 'Z', 'ᶏ' => 'a', 'Ḃ' => 'B', 'ḃ' => 'b', 'Ḅ' => 'B', 
'ḅ' => 'b', 'Ḇ' => 'B', 'ḇ' => 'b', 'Ƀ' => 'B', 'ƀ' => 'b', 'ᵬ' => 'B', 'ᶀ' => 'b', 
'Ɓ' => 'B', 'ɓ' => 'b', 'Ƃ' => 'B', 'ƃ' => 'b', 'Ć' => 'C', 'ć' => 'c', 'Ĉ' => 'C', 
'ĉ' => 'c', 'Č' => 'C', 'č' => 'c', 'Ċ' => 'C', 'ċ' => 'c', 'Ç' => 'C', 'ç' => 'c', 
'Ḉ' => 'C', 'ḉ' => 'c', 'Ȼ' => 'C', 'ȼ' => 'c', 'Ƈ' => 'C', 'ƈ' => 'c', 'ɕ' => 'c', 
'Ď' => 'D', 'ď' => 'd', 'Ḋ' => 'D', 'ḋ' => 'd', 'Ḑ' => 'D', 'ḑ' => 'd', 'Ḍ' => 'D', 
'ḍ' => 'd', 'Ḓ' => 'D', 'ḓ' => 'd', 'Ḏ' => 'D', 'ḏ' => 'd', 'Đ' => 'D', 'đ' => 'd', 
'ᵭ' => 'D', 'ᶁ' => 'd', 'Ɖ' => 'D', 'ɖ' => 'd', 'Ɗ' => 'D', 'ɗ' => 'd', 'ᶑ' => 'D', 
'Ƌ' => 'd', 'ƌ' => 'D', 'ȡ' => 'd', 'É' => 'E', 'é' => 'e', 'È' => 'E', 'è' => 'e', 
'Ĕ' => 'E', 'ĕ' => 'e', 'Ê' => 'E', 'ê' => 'e', 'Ế' => 'E', 'ế' => 'e', 'Ề' => 'e', 
'ề' => 'e', 'Ễ' => 'E', 'ễ' => 'e', 'Ể' => 'E', 'ể' => 'e', 'Ě' => 'e', 'ě' => 'e', 
'Ë' => 'E', 'ë' => 'e', 'Ẽ' => 'E', 'ẽ' => 'e', 'Ė' => 'E', 'ė' => 'e', 'Ȩ' => 'e', 
'ȩ' => 'e', 'Ḝ' => 'E', 'ḝ' => 'e', 'Ę' => 'E', 'ę' => 'e', 'Ē' => 'e', 'ē' => 'e', 
'Ḗ' => 'E', 'ḗ' => 'e', 'Ḕ' => 'E', 'ḕ' => 'e', 'Ẻ' => 'E', 'ẻ' => 'e', 'Ȅ' => 'e', 
'ȅ' => 'e', 'Ȇ' => 'E', 'ȇ' => 'e', 'Ẹ' => 'E', 'ẹ' => 'e', 'Ệ' => 'e', 'ệ' => 'e', 
'Ḙ' => 'E', 'ḙ' => 'e', 'Ḛ' => 'E', 'ḛ' => 'e', 'Ɇ' => 'E', 'ɇ' => 'e', 'ᶒ' => 'e', 
'Ḟ' => 'F', 'ḟ' => 'f', 'ᵮ' => 'f', 'ᶂ' => 'f', 'Ƒ' => 'F', 'ƒ' => 'f', 'Ǵ' => 'g', 
'ǵ' => 'g', 'Ğ' => 'G', 'ğ' => 'g', 'Ĝ' => 'G', 'ĝ' => 'g', 'Ǧ' => 'g', 'ǧ' => 'g', 
'Ġ' => 'G', 'ġ' => 'g', 'Ģ' => 'G', 'ģ' => 'g', 'Ḡ' => 'G', 'ḡ' => 'g', 'Ǥ' => 'g', 
'ǥ' => 'g', 'ᶃ' => 'g', 'Ɠ' => 'G', 'ɠ' => 'g', 'Ĥ' => 'H', 'ĥ' => 'h', 'Ȟ' => 'h', 
'ȟ' => 'h', 'Ḧ' => 'h', 'ḧ' => 'h', 'Ḣ' => 'h', 'ḣ' => 'h', 'Ḩ' => 'h', 'ḩ' => 'h', 
'Ḥ' => 'h', 'ḥ' => 'h', 'Ḫ' => 'h', 'ḫ' => 'h', 'H' => 'h', 'ẖ' => 'h', 
'Ħ' => 'h', 'ħ' => 'h', 'Ⱨ' => 'h', 'ⱨ' => 'h', 'Í' => 'i', 'í' => 'i', 'Ì' => 'i', 
'ì' => 'i', 'Ĭ' => 'i', 'ĭ' => 'i', 'Î' => 'i', 'î' => 'i', 'Ǐ' => 'i', 'ǐ' => 'i', 
'Ï' => 'i', 'ï' => 'i', 'Ḯ' => 'i', 'ḯ' => 'i', 'Ĩ' => 'i', 'ĩ' => 'i', 'İ' => 'i', 
'i' => 'i', 'Į' => 'i', 'į' => 'i', 'Ī' => 'i', 'ī' => 'i', 'Ỉ' => 'i', 'ỉ' => 'i', 
'Ȉ' => 'i', 'ȉ' => 'i', 'Ȋ' => 'i', 'ȋ' => 'i', 'Ị' => 'i', 'ị' => 'i', 'Ḭ' => 'i', 
'ḭ' => 'i', 'I' => 'i', 'ı' => 'i', 'Ɨ' => 'i', 'ɨ' => 'i', 'ᵻ' => 'i', 'ᶖ' => 'i', 
'Ĵ' => 'j', 'ĵ' => 'j', 'J' => 'j', 'ǰ' => 'j', 'ȷ' => 'j', 'Ɉ' => 'j', 
'ɉ' => 'j', 'ʝ' => 'j', 'ɟ' => 'j', 'ʄ' => 'j', 'Ḱ' => 'k', 'ḱ' => 'k', 'Ǩ' => 'k', 
'ǩ' => 'k', 'Ķ' => 'k', 'ķ' => 'k', 'Ḳ' => 'k', 'ḳ' => 'k', 'Ḵ' => 'k', 'ḵ' => 'k', 
'ᶄ' => 'k', 'Ƙ' => 'k', 'ƙ' => 'k', 'Ⱪ' => 'k', 'ⱪ' => 'k', 'Ĺ' => 'l', 'ĺ' => 'l', 
'Ľ' => 'l', 'ľ' => 'i', 'Ļ' => 'l', 'ļ' => 'l', 'Ḷ' => 'l', 'ḷ' => 'l', 'Ḹ' => 'l', 
'ḹ' => 'l', 'Ḽ' => 'l', 'ḽ' => 'l', 'Ḻ' => 'l', 'ḻ' => 'l', 'Ł' => 'l', 'ł' => 'l', 
'Ŀ' => 'l', 'ŀ' => 'l', 'Ƚ' => 'l', 'ƚ' => 'l', 'Ⱡ' => 'l', 'ⱡ' => 'l', 'Ɫ' => 'l', 
'ɫ' => 'l', 'ɬ' => 'l', 'ᶅ' => 'l', 'ɭ' => 'l', 'ȴ' => 'l', 'Ḿ' => 'm', 'ḿ' => 'm', 
'Ṁ' => 'm', 'ṁ' => 'm', 'Ṃ' => 'm', 'ṃ' => 'm', 'ᵯ' => 'm', 'ᶆ' => 'm', 'ɱ' => 'm', 
'Ń' => 'n', 'ń' => 'n', 'Ǹ' => 'n', 'ǹ' => 'n', 'Ň' => 'n', 'ň' => 'n', 'Ñ' => 'n', 
'ñ' => 'n', 'Ṅ' => 'n', 'ṅ' => 'n', 'Ņ' => 'n', 'ņ' => 'n', 'Ṇ' => 'n', 'ṇ' => 'n', 
'Ṋ' => 'n', 'ṋ' => 'n', 'Ṉ' => 'n', 'ṉ' => 'n', 'ᵰ' => 'n', 'Ɲ' => 'n', 'ɲ' => 'n', 
'Ƞ' => 'n', 'ƞ' => 'n', 'ᶇ' => 'n', 'ɳ' => 'n', 'ȵ' => 'n', 'Ó' => 'o', 'ó' => 'o', 
'Ò' => 'o', 'ò' => 'o', 'Ŏ' => 'o', 'ŏ' => 'o', 'Ô' => 'o', 'ô' => 'o', 'Ố' => 'o', 
'ố' => 'o', 'Ồ' => 'o', 'ồ' => 'o', 'Ỗ' => 'o', 'ỗ' => 'o', 'Ổ' => 'o', 'ổ' => 'o', 
'Ǒ' => 'o', 'ǒ' => 'o', 'Ö' => 'o', 'ö' => 'o', 'Ȫ' => 'o', 'ȫ' => 'o', 'Ő' => 'o', 
'ő' => 'o', 'Õ' => 'o', 'õ' => 'o', 'Ṍ' => 'o', 'ṍ' => 'o', 'Ṏ' => 'o', 'ṏ' => 'o', 
'Ȭ' => 'o', 'ȭ' => 'o', 'Ȯ' => 'o', 'ȯ' => 'o', 'Ȱ' => 'o', 'ȱ' => 'o', 'Ø' => 'o', 
'ø' => 'o', 'Ǿ' => 'o', 'ǿ' => 'o', 'Ǫ' => 'o', 'ǫ' => 'o', 'Ǭ' => 'o', 'ǭ' => 'o', 
'Ō' => 'o', 'ō' => 'o', 'Ṓ' => 'o', 'ṓ' => 'o', 'Ṑ' => 'o', 'ṑ' => 'o', 'Ỏ' => 'o', 
'ỏ' => 'o', 'Ȍ' => 'o', 'ȍ' => 'o', 'Ȏ' => 'o', 'ȏ' => 'o', 'Ơ' => 'o', 'ơ' => 'o', 
'Ớ' => 'o', 'ớ' => 'o', 'Ờ' => 'o', 'ờ' => 'o', 'Ỡ' => 'o', 'ỡ' => 'o', 'Ở' => 'o', 
'ở' => 'o', 'Ợ' => 'o', 'ợ' => 'o', 'Ọ' => 'o', 'ọ' => 'o', 'Ộ' => 'o', 'ộ' => 'o', 
'ᶗ' => 'o', 'Ɵ' => 'o', 'ɵ' => 'o', 'Ṕ' => 'p', 'ṕ' => 'p', 'Ṗ' => 'p', 'ṗ' => 'p', 
'Ᵽ' => 'p', 'ᵽ' => 'p', 'ᵱ' => 'p', 'ᶈ' => 'p', 'Ƥ' => 'p', 'ƥ' => 'p', 'ʠ' => 'q', 
'Ɋ' => 'q', 'ɋ' => 'q', 'Ŕ' => 'r', 'ŕ' => 'r', 'Ř' => 'r', 'ř' => 'r', 'Ṙ' => 'r', 
'ṙ' => 'r', 'Ŗ' => 'r', 'ŗ' => 'r', 'Ȑ' => 'r', 'ȑ' => 'r', 'Ȓ' => 'r', 'ȓ' => 'r', 
'Ṛ' => 'r', 'ṛ' => 'r', 'Ṝ' => 'r', 'ṝ' => 'r', 'Ṟ' => 'r', 'ṟ' => 'r', 'Ɍ' => 'r', 
'ɍ' => 'r', 'ᵲ' => 'r', 'ᶉ' => 'r', 'ɼ' => 'r', 'Ɽ' => 'r', 'ɽ' => 'r', 'ɾ' => 'r', 
'ᵳ' => 'r', 'Ś' => 's', 'ś' => 's', 'Ṥ' => 's', 'ṥ' => 's', 'Ŝ' => 's', 'ŝ' => 's', 
'Š' => 's', 'š' => 's', 'Ṧ' => 's', 'ṧ' => 's', 'Ṡ' => 's', 'ṡ' => 's', 'ẛ' => 's', 
'Ş' => 's', 'ş' => 's', 'Ṣ' => 's', 'ṣ' => 's', 'Ṩ' => 's', 'ṩ' => 's', 'Ș' => 's', 
'ș' => 's', 'ᵴ' => 's', 'ᶊ' => 's', 'ʂ' => 's', 'ȿ' => 's', 'S' => 's',
's' => 's', 'Ť' => 't', 'ť' => 't', 'T' => 't', 'ẗ' => 't', 'Ṫ' => 't', 
'ṫ' => 't', 'Ţ' => 't', 'ţ' => 't', 'Ṭ' => 't', 'ṭ' => 't', 'Ț' => 't', 'ț' => 't', 
'Ṱ' => 't', 'ṱ' => 't', 'Ṯ' => 't', 'ṯ' => 't', 'Ŧ' => 't', 'ŧ' => 't', 'Ⱦ' => 't', 
'ⱬ' => 'z', 'ᵵ' => 't', 'ƫ' => 't', 'Ƭ' => 't', 'ƭ' => 't', 'Ʈ' => 't', 'ʈ' => 't', 
'ȶ' => 't', 'Ú' => 'u', 'ú' => 'u', 'Ù' => 'u', 'ù' => 'u', 'Ŭ' => 'u', 'ŭ' => 'u', 
'Û' => 'u', 'û' => 'u', 'Ǔ' => 'u', 'ǔ' => 'u', 'Ů' => 'u', 'ů' => 'u', 'Ü' => 'u', 
'ü' => 'u', 'Ǘ' => 'u', 'ǘ' => 'u', 'Ǜ' => 'u', 'ǜ' => 'u', 'Ǚ' => 'u', 'ǚ' => 'u', 
'Ǖ' => 'u', 'ǖ' => 'u', 'Ű' => 'u', 'ű' => 'u', 'Ũ' => 'u', 'ũ' => 'u', 'Ṹ' => 'u', 
'ṹ' => 'u', 'Ų' => 'u', 'ų' => 'u', 'Ū' => 'u', 'ū' => 'u', 'Ṻ' => 'u', 'ṻ' => 'u', 
'Ủ' => 'u', 'ủ' => 'u', 'Ȕ' => 'u', 'ȕ' => 'u', 'Ȗ' => 'u', 'ȗ' => 'u', 'Ư' => 'u', 
'ư' => 'u', 'Ứ' => 'u', 'ứ' => 'u', 'Ừ' => 'u', 'ừ' => 'u', 'Ữ' => 'u', 'ữ' => 'u', 
'Ử' => 'u', 'ử' => 'u', 'Ự' => 'u', 'ự' => 'u', 'Ụ' => 'u', 'ụ' => 'u', 'Ṳ' => 'u', 
'ṳ' => 'u', 'Ṷ' => 'u', 'ṷ' => 'u', 'Ṵ' => 'u', 'ṵ' => 'u', 'Ʉ' => 'u', 'ʉ' => 'u', 
'ᵾ' => 'u', 'ᶙ' => 'u', 'Ṽ' => 'v', 'ṽ' => 'v', 'Ṿ' => 'v', 'ṿ' => 'v', 'ᶌ' => 'v', 
'Ʋ' => 'v', 'ʋ' => 'v', 'ⱴ' => 'v', 'Ẃ' => 'w', 'ẃ' => 'w', 'Ẁ' => 'w', 'ẁ' => 'w', 
'Ŵ' => 'w', 'ŵ' => 'w', 'W' => 'w', 'ẘ' => 'w', 'Ẅ' => 'w', 'ẅ' => 'w', 'Ẇ' => 'w', 
'ẇ' => 'w', 'Ẉ' => 'w', 'ẉ' => 'w', 'Ẍ' => 'x', 'ẍ' => 'x', 'Ẋ' => 'x', 'ẋ' => 'x', 
'ᶍ' => 'x', 'Ý' => 'y', 'ý' => 'y', 'Ỳ' => 'y', 'ỳ' => 'y', 'Ŷ' => 'y', 'ŷ' => 'y', 
'Y' => 'y', 'ẙ' => 'y', 'Ÿ' => 'y', 'ÿ' => 'y', 'Ỹ' => 'y', 'ỹ' => 'y', 'Ẏ' => 'y', 
'ẏ' => 'y', 'Ȳ' => 'y', 'ȳ' => 'y', 'Ỷ' => 'y', 'ỷ' => 'y', 'Ỵ' => 'y', 'ỵ' => 'y', 
'ʏ' => 'z', 'Ɏ' => 'y', 'ɏ' => 'y', 'Ƴ' => 'y', 'ƴ' => 'y', 'Ź' => 'z', 'ź' => 'z', 
'Ẑ' => 'z', 'ẑ' => 'z', 'Ž' => 'z', 'ž' => 'z', 'Ż' => 'z', 'ż' => 'z', 'Ẓ' => 'z', 
'ẓ' => 'z', 'Ẕ' => 'z', 'ẕ' => 'z', 'Ƶ' => 'z', 'ƶ' => 'z', 'ᵶ' => 'z', 'ᶎ' => 'z', 
'Ȥ' => 'z', 'ȥ' => 'z', 'ʐ' => 'z', 'ʑ' => 'z', 'ɀ' => 'z', 'Ⱬ' => 'z', 'ⱬ' => 'z' 	
	);
	
  public function __construct() {//Конструктор
    Service_Debug::setDebug();
  }

  /**
   * Генерирует и возвращает слово необходимой длины (английский+цифры)
   *
   * @param integer $num
   * @return string
   */
  public static function generateWord($num) {
    Service_Debug::setDebug();
  	$retString ='';
  	for ($i = 0; $i < $num; $i++) 
  	  $retString .= self::generateChar();
  	return $retString;
  }
  /**
   * генерирует и возвращает  символ (английский+цифры)
   *
   * @return string
   */
  public static function generateChar() {
    Service_Debug::setDebug();
    $simbolNum = rand(1,62);
    if ($simbolNum <= 10)       //48-57=10 - цифры
      $simbolNum += 47;   
    else if ($simbolNum <= 36)  //65-90=26 - большие буквы
      $simbolNum += 54;
    else                       //97-122=26 - маленькие буквы
      $simbolNum += 60;      
    return chr($simbolNum);      
  }
  
  /**
   * генерирует и возвращает маленькую английскую букву
   *
   * @return string
   */
  public static function generateSmallLetter() {
    Service_Debug::setDebug();
    return chr(rand(97,122)); 
  }  
  
  /**
   * генерирует и возвращает маленькую английскую гласную
   *
   * @return string
   */
  public static function generateSmallVowel() {
    Service_Debug::setDebug();
    switch (rand(1,6)) {
	    case 1:
		    return "a";;
	    case 2:
		    return "e";;
		  case 3:
        return "i";
		  case 4:
        return "o";
      case 5:
		    return "u";	
      case 6:
		    return "y";
	    default:
	      return "";
    }
  }    
  
  /**
   * генерирует и возвращает маленькую английскую согласную
   *
   * @return string
   */
  public static function generateSmallConsonant() {
    Service_Debug::setDebug();
    $simbolNum = rand(97,122);
    switch ( $simbolNum ) {
	    case 97:
		    return self::generateSmallConsonant();
	    case 101:
		    return self::generateSmallConsonant();
		  case 105:
        return self::generateSmallConsonant();
		  case 111:
        return self::generateSmallConsonant();
      case 117:
		    return self::generateSmallConsonant();	
      case 121:
		    return self::generateSmallConsonant();
	    default:
	      return chr($simbolNum);
    }     
  }
  
  /**
   * генерирует и возвращает "Человеческий пароль"
   *
   * @return string
   */
  public static function generatePassword() {  
    Service_Debug::setDebug();
    $password = "";
    $numsNum = rand(1, 3);//Количество цифр в пароле
    for ( $i = 0; $i < $numsNum; $i++) {
      $password .= chr(rand(48,57));
    }
    $placeOfNumbers = rand(0,1);
    if ($placeOfNumbers)//определяем, в начале или конце будут расположены цифры
      $password .= self::generatePasswordLetters(8 - $numsNum);
    else 
      $password = self::generatePasswordLetters(8 - $numsNum) . $password;  
    return $password;  
  }

  /**
   * генерирует и возвращает буквенную часть "Человеческого пароля"
   *
   * @param integer $lettersNum - количество букв, содержащееся в пароле
   * @return string
   */
  public static function generatePasswordLetters($lettersNum) {
    Service_Debug::setDebug();
    $text = "";
    $vowel = false;//Флаг того, какая буква (гласная/согласная)
    for ($i = 0; $i < $lettersNum; $i++)
    {
      if ($vowel)
        $text .= self::generateSmallVowel();  
      else
        $text .= self::generateSmallConsonant();  
      $vowel = !$vowel;
    }
    return $text;
  }
  
  /**
   * 
   * @param unknown_type $text
   */
	public static function generateAlias($text) {
	  Service_Debug::setDebug();
	  $text = strip_tags(strtr($text,self::$arrDiac));		  		
	  $text = preg_replace('/&.+?;/', '', $text);
		$text = strtr($text,self::$arrTrans);
		$text = preg_replace("/[^a-zA-Z0-9_]/","",$text);
		$text = preg_replace('/([_]){2,}/', '\1',$text);
		$text = trim($text, '_');
		$text = strtolower($text);
		return $text;
	}  
  
  public function __destruct() {//Деструктор
  
  }

	/**
	 * Генерирует секретный код для подтверждения e-mail
	 * 
	 * @param string $eMail
	 * @param string $login
	 */
	public static function generateApproveCode($eMail, $login) {
    return md5($eMail . md5($login . SECRET_WORD));
	}
}